/*
* @Author: Star
* @Date:   2018-10-07 19:01:37
* @Last Modified by:   Star
* @Last Modified time: 2018-10-26 18:56:27
*/

import * as types from './mutation-types'

// 定义 mutations 一个对象 ， 里面是方法
// 第一个参数是 state.js里面的 state 
// 第二个参数是 提交mutations 传递的 payload [ 参数 ]

const matutaions = {
	[types.SET_SINGER](state, singer) {
		state.singer = singer
	},
	[types.SET_PLAYING_STATE](state, flag) {
		state.playing = flag
	},
	[types.SET_FULL_SCREEN](state, flag) {
		state.fullScreen = flag
	},
	[types.SET_PLAY_LIST](state, list) {
		state.playlist = list
	},
	[types.SET_SEQUENCE_LIST](state, list) {
		state.sequenceList = list
	},
	[types.SET_PLAY_MODE](state, mode) {
		state.mode = mode
	},
	[types.SET_CURRENT_INDEX](state, index) {
		state.currentIndex = index
	},
	[types.SET_DISC](state, disc) {
		state.disc = disc
	},
	[types.SET_TOP_LIST](state, topList) {
		state.topList = topList
	},
	[types.SET_SEARCH_HISTORY](state, history) {
		state.searchHistory = history
	},
	[types.SET_PLAY_HISTORY](state, history) {
		state.playHistory = history
	},
	[types.SET_FAVORITE_LIST](state, list) {
		state.favoriteList = list
	}

}

export default matutaions